import { Pipe, PipeTransform } from '@angular/core';
import { environment } from 'src/environments/environment';

@Pipe({
  name: 'iconPath'
})
export class IconPathPipe implements PipeTransform {

  transform(value: any, type?: string, isReplace?: boolean): any {
    if(type === 'local'){
      if(isReplace){
        return (environment.localIconPath + value).replace('svg', 'png');
      }
      return environment.localIconPath + value
    }
    return environment.iconPath + value;
  }

}
